<?php
namespace App\Http\Controllers\WebApi\CenterCompany;

use App\Repositories\Admin\JobRepository;
use Illuminate\Http\Request;

class JobController extends BaseController
{
    /**
     * 招聘信息
     */

    protected $job;

    public function __construct()
    {
        parent::__construct();
        $this->job = new JobRepository();
    }

    /**
     * 岗位列表获取
     */
    public function getIndex(Request $request)
    {
        //接口权限值
        $wa = $request->post('wa','');
        if ($wa!=$this->web_access) {
            return $this->toJson(-1);
        }
        //用户登陆判断
        $token = $request->post('token','');
        $uid = $this->getUidByToken($token);
        if (!$uid) {
            return $this->toJson(-9);
        }
        //获取参数
        $page = $request->post('page',1);
        $querys = $this->job->getWebJobIndex($uid,$page);
        if (!$querys) {
            return $this->toJson(-3);
        }
        $dataArr = $querys;
        return $this->toJson(0,$dataArr);
    }

    /**
     * 岗位详情获取
     */
    public function getOne(Request $request)
    {
        //用户登陆判断
        $token = $request->post('token','');
        $uid = $this->getUidByToken($token);
        if (!$uid) {
            return $this->toJson(-9);
        }
        //获取参数
    }

    /**
     * 申请列表获取
     */
    public function getApplyList(Request $request)
    {
    }

    /**
     * 招聘交流
     */
    public function getTalk(Request $request)
    {
    }

    /**
     * 面试邀请
     */
    public function setInvite(Request $request)
    {
    }

    /**
     * 入职邀请
     */
    public function setOffer(Request $request)
    {
    }

    /**
     * 入职确认
     */
    public function setOfferSure(Request $request)
    {
    }

    /**
     * 招聘评价
     */
    public function setComment(Request $request)
    {
    }
}